package com.finger.forest.base;

import android.content.Context;

import com.finger.forest.http.NetManager;

/**
 * 基类的p层
 *
 * @param <T>
 */
public abstract class BasePresenter<T> {
    protected NetManager manager;
    protected T view;
    protected Context context;

    public BasePresenter() {
    }

    public void attachView(T view, Context context) {
        this.view = view;
        this.context = context;
        manager = new NetManager(context);
        manager.setView((BaseView) view);
    }

    /**
     * 关闭p层
     */
    public void close() {
        if (manager != null) {
            manager.close();
//            manager = null;
        }
    }
}
